package com.terrynoya.fight.system.camera
{
	import com.terrynoya.geom.MVector2D;
	
	import flash.geom.Rectangle;

	public class MCamera
	{
		private var _position:MVector2D;
		
		private var _rect:Rectangle;
		
		public function MCamera(viewPortRect:Rectangle)
		{
			this._position = new MVector2D();
			this._rect = viewPortRect;
		}
		
		public function set x(value:Number):void 
		{
			this._position.x = value;
		}
		
		public function get x():Number 
		{
			return this._position.x;
		}
		
		public function get y():Number 
		{
			return this._position.y;
		}
		
		public function set y(value:Number):void 
		{
			this._position.y = value;
		}
		
		public function get position():MVector2D
		{
			return _position;
		}
		
		public function get left():Number 
		{
			return this.position.x - this.width / 2;
		}
		
		public function get right():Number 
		{
			return this.position.x + this.width / 2;
		}

		public function set position(value:MVector2D):void
		{
			_position = value;
		}

		public function get width():int
		{
			return this._rect.width;
		}
		
		public function get height():int
		{
			return this._rect.height;
		}
	}
}